home *** CD-ROM | disk | FTP | other *** search
/ BMUG Revelations / BMUG Revelations.toast / Programming / Programming Languages / Harvest C / MPW Int & Lib / Interfaces / Lists.h < prev    next >
Text File  |  1991-04-17  |  5KB  |  151 lines

  1. /************************************************************
  2.  
  3. Created: Monday, January 7, 1991 at 5:54 AM
  4.     Lists.h
  5.     C Interface to the Macintosh Libraries
  6.  
  7.  
  8.         Copyright Apple Computer, Inc.    1985-1990
  9.         All rights reserved
  10.  
  11. ************************************************************/
  12.  
  13.  
  14. #ifndef __LISTS__
  15. #define __LISTS__
  16.  
  17. #ifndef __TYPES__
  18. #include <Types.h>
  19. #endif
  20.  
  21. #ifndef __CONTROLS__
  22. #include <Controls.h>
  23. #endif
  24.  
  25. #ifndef __MEMORY__
  26. #include <Memory.h>
  27. #endif
  28.  
  29.  
  30. enum {
  31.  
  32.     lDoVAutoscroll = 2,
  33.     lDoHAutoscroll = 1,
  34.     lOnlyOne = -128,
  35.     lExtendDrag = 64,
  36.     lNoDisjoint = 32,
  37.     lNoExtend = 16,
  38.     lNoRect = 8,
  39.     lUseSense = 4,
  40.     lNoNilHilite = 2,
  41.     lInitMsg = 0,
  42.     lDrawMsg = 1,
  43.     lHiliteMsg = 2,
  44.     lCloseMsg = 3
  45. };
  46.  
  47. typedef Point Cell;
  48.  
  49. typedef char DataArray[32001],*DataPtr,**DataHandle;
  50. typedef pascal short (*SearchProcPtr)(Ptr aPtr, Ptr bPtr, short aLen, short bLen);
  51.  
  52. struct ListRec {
  53.     Rect rView;
  54.     GrafPtr port;
  55.     Point indent;
  56.     Point cellSize;
  57.     Rect visible;
  58.     ControlHandle vScroll;
  59.     ControlHandle hScroll;
  60.     char selFlags;
  61.     Boolean lActive;
  62.     char lReserved;
  63.     char listFlags;
  64.     long clikTime;
  65.     Point clikLoc;
  66.     Point mouseLoc;
  67.     ProcPtr lClikLoop;
  68.     Cell lastClick;
  69.     long refCon;
  70.     Handle listDefProc;
  71.     Handle userHandle;
  72.     Rect dataBounds;
  73.     DataHandle cells;
  74.     short maxIndex;
  75.     short cellArray[1];
  76. };
  77.  
  78. typedef struct ListRec ListRec;
  79. typedef ListRec *ListPtr, **ListHandle;
  80.  
  81.  
  82. #ifdef __cplusplus
  83. extern "C" {
  84. #endif
  85. ListHandle lnew(Rect *rView,Rect *dataBounds,Point *cSize,short theProc,
  86.     WindowPtr theWindow,Boolean drawIt,Boolean hasGrow,Boolean scrollHoriz,
  87.     Boolean scrollVert); 
  88. pascal ListHandle LNew(const Rect *rView,const Rect *dataBounds,Point cSize,
  89.     short theProc,WindowPtr theWindow,Boolean drawIt,Boolean hasGrow,Boolean scrollHoriz,
  90.     Boolean scrollVert)
  91.     = {0x3F3C,0x0044,0xA9E7}; 
  92. pascal void LDispose(ListHandle lHandle)
  93.     = {0x3F3C,0x0028,0xA9E7}; 
  94. pascal short LAddColumn(short count,short colNum,ListHandle lHandle)
  95.     = {0x3F3C,0x0004,0xA9E7}; 
  96. pascal short LAddRow(short count,short rowNum,ListHandle lHandle)
  97.     = {0x3F3C,0x0008,0xA9E7}; 
  98. pascal void LDelColumn(short count,short colNum,ListHandle lHandle)
  99.     = {0x3F3C,0x0020,0xA9E7}; 
  100. pascal void LDelRow(short count,short rowNum,ListHandle lHandle)
  101.     = {0x3F3C,0x0024,0xA9E7}; 
  102. pascal Boolean LGetSelect(Boolean next,Cell *theCell,ListHandle lHandle)
  103.     = {0x3F3C,0x003C,0xA9E7}; 
  104. pascal Cell LLastClick(ListHandle lHandle)
  105.     = {0x3F3C,0x0040,0xA9E7}; 
  106. pascal Boolean LNextCell(Boolean hNext,Boolean vNext,Cell *theCell,ListHandle lHandle)
  107.     = {0x3F3C,0x0048,0xA9E7}; 
  108. pascal Boolean LSearch(const void *dataPtr,short dataLen,SearchProcPtr searchProc,
  109.     Cell *theCell,ListHandle lHandle)
  110.     = {0x3F3C,0x0054,0xA9E7}; 
  111. pascal void LSize(short listWidth,short listHeight,ListHandle lHandle)
  112.     = {0x3F3C,0x0060,0xA9E7}; 
  113. pascal void LDoDraw(Boolean drawIt,ListHandle lHandle)
  114.     = {0x3F3C,0x002C,0xA9E7}; 
  115. pascal void LScroll(short dCols,short dRows,ListHandle lHandle)
  116.     = {0x3F3C,0x0050,0xA9E7}; 
  117. pascal void LAutoScroll(ListHandle lHandle)
  118.     = {0x3F3C,0x0010,0xA9E7}; 
  119. pascal void LUpdate(RgnHandle theRgn,ListHandle lHandle)
  120.     = {0x3F3C,0x0064,0xA9E7}; 
  121. pascal void LActivate(Boolean act,ListHandle lHandle)
  122.     = {0x4267,0xA9E7}; 
  123. pascal void LCellSize(Point cSize,ListHandle lHandle)
  124.     = {0x3F3C,0x0014,0xA9E7}; 
  125. pascal Boolean LClick(Point pt,short modifiers,ListHandle lHandle)
  126.     = {0x3F3C,0x0018,0xA9E7}; 
  127. pascal void LAddToCell(const void *dataPtr,short dataLen,Cell theCell,ListHandle lHandle)
  128.     = {0x3F3C,0x000C,0xA9E7}; 
  129. pascal void LClrCell(Cell theCell,ListHandle lHandle)
  130.     = {0x3F3C,0x001C,0xA9E7}; 
  131. pascal void LGetCell(void *dataPtr,short *dataLen,Cell theCell,ListHandle lHandle)
  132.     = {0x3F3C,0x0038,0xA9E7}; 
  133. pascal void LFind(short *offset,short *len,Cell theCell,ListHandle lHandle)
  134.     = {0x3F3C,0x0034,0xA9E7}; 
  135. pascal void LRect(Rect *cellRect,Cell theCell,ListHandle lHandle)
  136.     = {0x3F3C,0x004C,0xA9E7}; 
  137. pascal void LSetCell(const void *dataPtr,short dataLen,Cell theCell,ListHandle lHandle)
  138.     = {0x3F3C,0x0058,0xA9E7}; 
  139. pascal void LSetSelect(Boolean setIt,Cell theCell,ListHandle lHandle)
  140.     = {0x3F3C,0x005C,0xA9E7}; 
  141. pascal void LDraw(Cell theCell,ListHandle lHandle)
  142.     = {0x3F3C,0x0030,0xA9E7}; 
  143. void ldraw(Cell *theCell,ListHandle lHandle); 
  144. Boolean lclick(Point *pt,short modifiers,ListHandle lHandle); 
  145. void lcellsize(Point *cSize,ListHandle lHandle); 
  146. #ifdef __cplusplus
  147. }
  148. #endif
  149.  
  150. #endif
  151.